import axios from 'axios';
import store from '../store';
import { getPreview } from './getPreview';

export function getFolders(){
    return axios.get('/getFolder')
    .then(function(response) {
        store.dispatch({
            type: 'GET_FOLDER',
            folderList: response.data.folderList
        });
        getPreview(response.data.folderList[0].name)
        return response;
    })
    .catch(function(err) {
        console.log(err)
    })
}